<template>
	<view style="position: relative;">
		<view class="scroll col-center">
			<scroll-view :scroll-x="true">
				<view class="row" style="margin-left: 20rpx;margin-right: 20rpx;" >
						<view :class="clickIndex==index?'acticve row-ceneter':'normal row-ceneter'" v-for="item,index in statusList" @click="clickIndex = index">
							{{item.name}}
						</view>
				</view>
			</scroll-view>
		</view>
	

		<view class="item" v-for="item in 4">
			<view class="top col" @click="goReport">
				<view class="row-between-center">
					<view class="row type">
						<image src="/static/images/read.png" class="type-img"></image>
						<view class="type-text">读书会</view>
					</view>
					<view class="status">进行中</view>
				</view>
				
				<view class="row" style="margin-top: 22rpx;">
					<image src="/static/images/lucky.png" class="img"></image>
					<view class="col-center-start" style="margin-left: 40rpx;">
						<view class="title">这是活动的名称</view>
						<view class="row-h-center"  style="margin-top: 10rpx;"> 
							<image src="/static/images/count.png" class="icon"></image>
							<view class="desc">12/20</view>
						</view>
						<view class="row-h-center" style="margin-top: 10rpx;">
							<image src="/static/images/location2.png" class="icon"></image>
							<view class="desc">青岛市黄岛区广西路60号</view>
						</view>
						<view class="row-h-center"  style="margin-top: 10rpx;">
							<image src="/static/images/time.png" class="icon"></image>
							<view class="desc">08.12 12:00 - 08.20 12:00</view>
						</view>
					</view>
				</view>
			</view>
			
			<view class="row-between-center" style="margin:20rpx;">
				<view class="price">免费</view>
				<view class="row">
					<view class="cancel row-center" @click="cancel(item)">取消活动</view>
					<view class="modify row-center" >修改</view>
				</view>
			</view>
			<view style="height: 20rpx;"></view>
		</view>
		
		
		
		<view class="add row-center" @click="goAdd">
			<image src="/static/images/add_person.png" class="add-img"></image>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				clickIndex:0,
				statusList:[
					{'name':'全部'},
					{'name':'待审核'},
					{'name':'进行中'},
					{'name':'已结束'},
					{'name':'已驳回'},
				]
			}
		},
		methods: {
			cancel(){
				uni.showModal({
					title:'确定取消活动吗？'
				})
			},
			goAdd(){
				uni.navigateTo({
					url:'/src/pages/merchant_activity/create_activity'
				})
			},
			goReport(){
				uni.navigateTo({
					url:'/src/pages/merchant_activity/activity_manage'
				})
			}
		}
	}
</script>
<style>
	page{
		background: #F2F3F8;
	}
</style>
<style scoped lang="scss">
	.add-img{
		width: 32rpx;
		height: 32rpx;
	}
	.add{
		
		z-index: 99;
		right: 20rpx;
		bottom: 220rpx;
		position: fixed;
		width: 88rpx;
		height: 88rpx;
		border-radius: 50%;
		background-color: #FFF;
		filter: drop-shadow(0px 4px 8px rgba(0, 0, 0, 0.08));
	}
	.scroll{
		height: 92rpx;
		background-color: white;
	}
	.item{
		margin: 20rpx;
		border-radius: 12rpx;
		background-color: #F7F8FC;
		.top{
			padding: 20rpx;
			border-radius: 12rpx 0;
			background-color: white;
		}
		.type{
			background: #FFE9D7;
			.type-img{
				width: 32rpx;
				height: 32rpx;
			}
			.type-text{
				margin-right: 10rpx;
				margin-left: 10rpx;
				color: #CD5F28;
				font-size: 20rpx;
				font-style: normal;
				font-weight: 400;
				line-height: 36rpx; /* 180% */
			}
		}
		.status{
			color:  #3B60D3;
			font-size: 28rpx;
			font-style: normal;
			font-weight: 500;
			line-height: 44rpx; /* 157.143% */
		}
		.img{
			border-radius: 12rpx;
			width: 200rpx;
			height: 160rpx;
			flex-shrink: 0;
		}
		.title{
			color: #1E2132;
			font-size: 32rpx;
			font-style: normal;
			font-weight: 500;
			line-height: 48rpx; /* 150% */
		}
		.icon{
			width: 32rpx;
			height: 32rpx;
		}
		.desc{
			color:  #6A6876;
			font-size: 24rpx;
			font-style: normal;
			font-weight: 400;
			line-height: 40rpx; /* 166.667% */
		}
		.price{
			color: #FF8934;
			font-size: 32rpx;
			font-style: normal;
			font-weight: 500;
			line-height: 48rpx; /* 150% */
		}
		.cancel{
			margin-right: 20rpx;
			width: 152rpx;
			height: 64rpx;
			flex-shrink: 0;
			border-radius: 16px;
			background: rgba(106, 104, 118, 0.25);
			color: #6A6876;
			font-size: 24rpx;
			font-style: normal;
			font-weight: 500;
			line-height: 40rpx; /* 166.667% */
		}
		.modify{
			width: 152rpx;
			height: 64rpx;
			flex-shrink: 0;
			border-radius: 16px;
			color: #FFF;
			text-align: center;
			font-size: 24rpx;
			font-style: normal;
			font-weight: 500;
			line-height: 40rpx; /* 166.667% */
			background:  #3B60D3;
		}
	}
	
	.acticve{
		white-space:nowrap;
		margin-right: 20rpx;
		padding: 6rpx 38rpx;
		border-radius: 8rpx;
		background: #347FFF;
		color: #FFF;
		font-size: 24rpx;
		font-style: normal;
		font-weight: 400;
		line-height: 40rpx; /* 166.667% */
	}
	.normal{
		white-space:nowrap;
		padding: 6rpx 38rpx;
		margin-right: 20rpx;
		border-radius: 8rpx;
		background: #F2F3F8;
		color: #676C7F;
		font-size: 24rpx;
		font-style: normal;
		font-weight: 400;
		line-height: 40rpx; /* 166.667% */
	}
</style>
